package com.jeequan.jeepay.pay.rqrs.payorder.payway;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.pay.rqrs.payorder.CommonPayDataRQ;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import jakarta.validation.constraints.NotBlank;


/**
 * none.
 *
 * @author 陈泉
 * @package com.jeequan.jeepay.pay.rqrs.payorder.payway
 * @create 2024/12/4 17:52
 */
@Data
public class AirPcOrderRQ extends CommonPayDataRQ {

    /**
     * 商品描述信息
     **/
    @NotBlank(message = "支付成功返回站点")
    private String successUrl;

    @NotBlank(message = "支付失败返回站点")
    private String failUrl;

    public AirPcOrderRQ() {
        this.setWayCode(CS.PAY_WAY_CODE.AIR_PC);
        JSONObject json = JSON.parseObject(StringUtils.defaultIfEmpty(this.getChannelExtra(), "{}"), JSONObject.class);
        this.setSuccessUrl(json.getString("successUrl"));
    }
}
